home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 May
/
EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso
/
softwareupdate
/
system
/
amigados
/
amigadoslibrary
/
close.c.guide
(
.txt
)
< prev
next >
Wrap
Amigaguide Document
|
1996-10-10
|
1KB
|
29 lines
/* Close.c V1.0 93-03-15 */
/* ROM library: "dos.library/Close", (All versions) */
/* Copyright 1993, Anders Bjerin, Amiga C Club */
#include <dos/dos.h>
#include <clib/dos_protos.h>
#include <stdio.h>
#include <stdlib.h>
UBYTE *version = "$VER: Close 1.0";
int main( int argc, char *argv[] );
int main( int argc, char *argv[] )
BPTR my_file;
/* Open a new file: */
my_file = Open( "RAM:Score.dat", MODE_NEWFILE );
/* OK? */
if( !my_file )
/* Could not open the file! */
printf( "Error! Could not open the file!\n" );
exit( 20 );
printf( "File open!\n" );
/* - - - */
/* Close the file: */
if( Close( my_file ) )
printf( "File closed!\n" );
else
printf( "Error! File could not be closed!\n" );
/* Remember that even if the file could not be */
/* closed we must NOT try to close it again! */
exit( 0 );